#lang racket

; Reference 2.4
; https://www.scheme.com/tspl4/start.html#./start:h0


(let ([a 4] [b -3])
  (let ([a-squared (* a a)]
        [b-squared (* b b)])
    (+ a-squared b-squared)))

(let ([x 1])
  (let ([x (+ 1 x)])
    (* x x)))

(let ([a 2] [b 3])
  (let ([a3 (* 3 a)])
    (+ (- a3 b)(+ a3 b))))

(let ([lista (list 'a 'b 'c)])
  (cons (car lista)(car(cdr lista))))


; Exercise 2.4.3
(define experssionA
  (let ([x 'a][y 'b])
    (list (let ([x 'c])(cons x y))
          (let ([y 'd])(cons x y)))))

(define expressionB
  (let ([x '((a b) c)])
    (cons (let ([x (cdr x)])(car x))
          (let ([x (car x)])
            (cons (let ([x (cdr x)])
                    (car x))
                    (cons (let ([x (car x)]) x)
                          (cdr x)))))))
                            






    








